<html>
  <head>
  	<title>Authorize</title>
  	<script type="text/javascript" src="templates/default/js/min.js"></script>
  	<script language="javascript">
  		function api_form_submit() {
  			{if $GLOBALS[_J][uid]>0}
				return true;
  			{/if}
  	  		
			if( ( '' == $('#username').val() ) || ( '' == $('#password').val() ) ) {
				alert('用户昵称或密码不能为空');
				return false;
			}
  	  		
  	  		var formObj = $('#api_form');
  	  		$.post(
				formObj.attr('action') + '&in_ajax=1',
				formObj.serialize(),
				function (r) {
					if(r.done) {
						$('#accept').attr('disabled', 'true');
						//return true;
						formObj.submit();
					} else {
						//$('#msg_div').html(r.msg);
						alert(r.msg);
						//return false;
					}
				},
				'json'
  	    	);

  	    	return false;
  		}
  	</script>  	
    
    <style type="text/css">
	body{font-family:"Microsoft YaHei","微软雅黑",tahoma,arial,simsun,"宋体"; font-size:14px;}
	input{ box-shadow: 2px 2px 2px #F0F0F0 inset;padding: 4px;border: 1px solid #CECECF;}
	.logo{ width:600px; height:100px; margin:0 auto; overflow:hidden;}
	.logo a{width:400px; height:100px; display:block;text-decoration:none;background:url(../../../images/logo_guest.png) no-repeat;}
	.main{ width:560px; margin:0 auto; background-color:#fff; padding:50px 20px;border-top: 3px solid #369;}
    .error_msg{ background:#f66; padding:10px;}
	ul.login{ display:block; clear:both;}
	ul.login li{ padding:5px 0; display:block;}
    
    </style>
    
    
  </head>
  <body>
  <div class="logo">
  <a title="{conf site_name}" href="index.php"></a>
  </div>
  <div class="main">
  <!--{if $error_msg}-->
  <div class="error_msg">{$error_msg}</div>
  <!--{else}-->  
    <form id="api_form" method="post" action="api.php?mod=oauth2&code=authorize" onSubmit="return api_form_submit()">
    	<input type="hidden" name="act" value="do" />
    <!--{loop $auth_params $k $v}-->
    	<input type="hidden" name="{$k}" value="{$v}" />
    <!--{/loop}-->
     <div class="login">
      	<p style="text-align: center;border-bottom: 1px dotted #DDD;padding-bottom: 15px;width: 500px;margin: 0 auto;margin-bottom: 25px;">用{conf site_name}帐号登录<a href="{$client_info[source_url]}" target="_blank">{$client_info[app_name]}</a></p>
         
      	<!--{if $GLOBALS[_J][uid]>0}-->
        <p style=" text-align:center">
      	<img src="{$GLOBALS[_J][member][face_small]}" /><br>
      	{$GLOBALS[_J][nickname]}
        </p>
      	<!--{else}-->
        <p>
      	用户昵称：<input type="text" id="username" name="username" value=""  style="margin-right:10px;"/>
      	用户密码：<input type="password" id="password" name="password" value="" />
        </p>
        <!--{/if}-->
      
      
      <div id="msg_div"></div>
      <p style="text-align:center;">
        <input type="submit" id="accept" name="accept" value=" 登 录 " /> 
        <input type="button" value="取 消" onClick="window.close();" />
        <!--{if MEMBER_ID<1}--><a href="index.php?mod=get_password" target="_blank">忘记密码？</a><!--{/if}-->       
      </p>
      </div>
    </form>  
  <!--{/if}-->
  </div>
  </body>
</html>